<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form class="layui-form" lay-filter="abc">
        <input type="text" name="username">账户
        <input type="password" name="pwd">密码
        <input type="text" name="nickname">昵称
    </form>
</body>
<script>
    // 后端反回来的数据
    // 要求: 把后端返给我们的数据快速填充到上面的表单内
    const res = {
        username: '张三',
        pwd: 123456,
        nickname: '小李子',
        aaaaa: 123
    }
    // layui的form模块提供快速填表单的方法
    const { form } = layui;
    //给表单赋值
    form.val("abc", res);
</script>

</html>